package com.lottery.system.service.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: xiaoxie
 * create: 2024-09-02 23:04
 * @BelongsProject: lottery-system
 * @BelongsPackage: com.lottery.system.service.enums
 * description: 用户身份枚举
 */
@Getter
@AllArgsConstructor
public enum IdentifyEnum {
    ADMIN("管理员"),
    NORMAL("普通用户");
    private final String msg;

    /**
     * @description: 查询身份是否存在
     * @author: xiaoxie
     * @date: 2024/9/2 23:09
     * @param: [name]
     * @return: com.lottery.system.service.enums.IdentifyEnum
     **/
    public static IdentifyEnum forName(String name) {
        for (IdentifyEnum userIdentityEnum :IdentifyEnum.values()) {
            if (userIdentityEnum.name().equalsIgnoreCase(name)) {
                return userIdentityEnum;
            }
        }
        return null;
    }
}
